package com.hy.demo.ui;

import androidx.recyclerview.widget.RecyclerView;

import com.hy.demo.R;
import com.hy.demo.app.BaseActivity;
import com.hy.demo.util.MenuViewUtil;

/**
 * title 无
 * author heyan
 * time 19-7-11 下午3:27
 * desc 无
 */
public class MenuActivity extends BaseActivity {

    private RecyclerView rcyList;

    @Override
    protected int getLayoutId() {
        return R.layout.v_rcy;
    }

    @Override
    protected void initView() {
        rcyList = findViewById(R.id.rcy_rcyList);
    }

    @Override
    protected void initData() {
        String title = null;
        int xmlId = 0;
        if (getArgs() != null) {
            xmlId = getArgs().getInt(MenuViewUtil.ARG_XML);
            title = getArgs().getString(MenuViewUtil.ARG_TITLE);
        }
        if (xmlId <= 0) {
            finish();
            return;
        }
        setTitle(title);
        MenuViewUtil.attach(rcyList, xmlId, this);
    }

}
